package com.huyi.web.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.huyi.web.entity.User;

/**
 * 继承BaseMapper，里面已经实现了单表的增删改查操作
 * 
 * @author shengli.hu
 *
 */
@Repository
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from sys_user where login_id = #{loginId}")
    @Results({
        @Result(column="user_id",property="userId"),
        @Result(column="login_id",property="loginId"),
        @Result(column="user_name",property="userName"),
        @Result(column="gender",property="gender"),
        @Result(column="age",property="age"),
        @Result(column="password",property="password")
    })
    User findUserByLoginId(String loginId);

	List<User> queryUserInfoByUserId(String userId);

}
